package com.xxx.video.commen.adapters;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;


import com.xxx.video.R;

import butterknife.BindView;

public class IosSingleChooseListAdapter extends BaseRecycleViewAdapter<String, IosSingleChooseListAdapter.MyHolder> {


    public IosSingleChooseListAdapter(@NonNull Context context) {
        super(context);
    }

    @Override
    public MyHolder onCreateDefaultViewHolder(View view, int viewType) {
        return new MyHolder(view);
    }

    @Override
    public int getItemLayout(int viewType) {
        return R.layout.item_dialog_ios_single_choose_list;
    }

    class MyHolder extends BaseViewHolder {
        @BindView(R.id.v_item_ios_single_choose_list_top_space)
        View vItemIosSingleChooseListTopSpace;
        @BindView(R.id.tv_item_ios_single_choose_list_context)
        TextView tvItemIosSingleChooseListContext;

        public MyHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void setData2View(int position) {
            vItemIosSingleChooseListTopSpace.setVisibility(View.GONE);
            if (position == 0) {
                vItemIosSingleChooseListTopSpace.setVisibility(View.VISIBLE);
            }
            String text = getItem(position);
            tvItemIosSingleChooseListContext.setText(text);
        }
    }
}
